package com.yuanfeng.business.controller;

import com.yuanfeng.commoms.util.ResponseResult;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @ClassName ShopJoinPayController
 * @Description 支付凭证
 * @Author cf
 * @Date 2023/6/21 11:39
 * @Version 1.0
 */
@RestController
@RequestMapping("/shop/join/pay")
public class ShopJoinPayController extends BaseController{

    /**
     * 店铺入驻-上传支付凭证
     *
     * @param param
     * @return
     */
    @PostMapping("/upload")
    public ResponseResult uploadPayEvidence(@RequestBody Map<String,Object> param) {
        return shopJoinPayService.uploadPayEvidence(param);
    }

    /**
     * 平台-审核商户付款
     *
     * @param param
     * @return
     */
    @GlobalTransactional
    @PostMapping("/audit")
    public ResponseResult auditShopJoinPay(@RequestBody Map<String, Object> param) {
        ResponseResult results = shopJoinPayService.auditShopJoinPay(param);
        return results;
    }

    /**
     * 平台-审核商家入驻付款详情
     *
     * @param param
     * @return
     */
    @PostMapping("/query/detail")
    public ResponseResult queryShopPayDetail(@RequestBody Map<String, Object> param) {
        ResponseResult results = shopJoinPayService.queryShopPayDetail(param);
        return results;
    }

    /**
     * 平台-审核商家入驻付款列表
     *
     * @param param
     * @return
     */
    @PostMapping("/query/list")
    public ResponseResult queryShopPayList(@RequestBody Map<String, Object> param) {
        ResponseResult results = shopJoinPayService.queryShopPayList(param);
        return results;
    }


    /**
     * 查询平台待办事项
     * @return
     */
    @PostMapping("/platform/pendingProcessing")
    public ResponseResult pendingprocessing() {
        ResponseResult results = shopJoinPayService.pendingprocessing();
        return results;
    }
}
